import Vue from 'vue';
import VueRouter from 'vue-router';
import index from '../views/index.vue'
import login from '../views/account/login.vue';
Vue.use(VueRouter)

const routes = [
	// 主页
	{
		path: '/',
		name: 'index',
		component: index
	},
	// 登录
	{
		path: '/account/login',
		name: 'login',
		component: login
	},
	// 忘记密码
	{
		path: '/account/forgot',
		name: 'forgot',
		component: () => import('../views/account/forgot.vue')
	},
	// 注册账号
	{
		path: '/account/register',
		name: 'register',
		component: () => import('../views/account/register.vue')
	},
		// 媒体图片
	{
		path: '/media/image',
		name: 'media_image',
		component: () => import('../views/media/image.vue')
	},

	// 音乐
	// {
	// 	path: '/media/music',
	// 	name: 'media_music',
	// 	component: () => import('../views/media/music.vue')
	// },
	// 媒体视频
	{
		path: '/media/video',
		name: 'media_video',
		component: () => import('../views/media/video.vue')
	},
	// 媒体视频
	{
		path: '/user_center/index',
		name: 'user_center_index',
		component: () => import('../views/user_center/index.vue')
	},
	// 文章路由
	{
		path: '/article/list',
		name: 'article_list',
		component: () => import('../views/article/list.vue')
	},
	{
		path: '/article/details',
		name: 'article_details',
		component: () => import('../views/article/details.vue')
	},
	// 浏览网站
	// 收藏路由
	{
		path: '/user/collect',
		name: 'collect_list',
		component: () => import('../views/user/collect.vue')
	},

	// 论坛路由
	{
		path: '/forum/list',
		name: 'forum_list',
		component: () => import('../views/forum/list.vue')
	},

	{
		path: '/forum/details',
		name: 'forum_details',
		component: () => import('../views/forum/details.vue')
	},
	{
		path: '/forum/edit',
		name: 'forum_edit',
		component: () => import('../views/forum/edit.vue')
	},
	{
		path: '/forum/table',
		name: 'forum_table',
		component: () => import('../views/forum/table.vue')
	},
	{
		path: '/forum/view',
		name: 'forum_view',
		component: () => import('../views/forum/view.vue')
	},

	{
		path: '/comment/table',
		name: 'comment_table',
		component: () => import('../views/comment/table.vue')
	},
	{
		path: '/comment/view',
		name: 'comment_view',
		component: () => import('../views/comment/view.vue')
	},

	


	{
		path: '/chat',
		name: 'chat',
		component: () => import('../views/chat/index.vue')
	},

	// 公告路由
	{
		path: '/notice/list',
		name: 'notice_list',
		component: () => import('../views/notice/list.vue')
	},
	{
		path: '/notice/details',
		name: 'notice_details',
		component: () => import('../views/notice/details.vue')
	},
	// 普通用户表格路由
	{
		path: '/ordinary_user/table',
		name: '/ordinary_user_table',
		component: () => import('../views/ordinary_user/table.vue')
	},
	// 普通用户详情路由
	{
		path: '/ordinary_user/view',
		name: '/ordinary_user_view',
		component: () => import('../views/ordinary_user/view.vue')
	},
	
	
		
		
		
	// 专家用户表格路由
	{
		path: '/expert_user/table',
		name: '/expert_user_table',
		component: () => import('../views/expert_user/table.vue')
	},
	// 专家用户详情路由
	{
		path: '/expert_user/view',
		name: '/expert_user_view',
		component: () => import('../views/expert_user/view.vue')
	},
	
	
		
		
		
	// 健康档案表格路由
	{
		path: '/health_archives/table',
		name: '/health_archives_table',
		component: () => import('../views/health_archives/table.vue')
	},
	// 健康档案详情路由
	{
		path: '/health_archives/view',
		name: '/health_archives_view',
		component: () => import('../views/health_archives/view.vue')
	},
	
	
		
		
		
	// 菜谱分类表格路由
	{
		path: '/recipe_classification/table',
		name: '/recipe_classification_table',
		component: () => import('../views/recipe_classification/table.vue')
	},
	// 菜谱分类详情路由
	{
		path: '/recipe_classification/view',
		name: '/recipe_classification_view',
		component: () => import('../views/recipe_classification/view.vue')
	},
	
	
		
		
		
	// 医疗菜谱表格路由
	{
		path: '/medical_recipes/table',
		name: '/medical_recipes_table',
		component: () => import('../views/medical_recipes/table.vue')
	},
	// 医疗菜谱详情路由
	{
		path: '/medical_recipes/view',
		name: '/medical_recipes_view',
		component: () => import('../views/medical_recipes/view.vue')
	},
	
		// 医疗菜谱列表路由
	{
		path: '/medical_recipes/list',
		name: '/medical_recipes_list',
		component: () => import('../views/medical_recipes/list.vue')
	},
	
		// 医疗菜谱详情路由
	{
		path: '/medical_recipes/details',
		name: '/medical_recipes_details',
		component: () => import('../views/medical_recipes/details.vue')
	},
		
		
		
	// 专家分类表格路由
	{
		path: '/expert_classification/table',
		name: '/expert_classification_table',
		component: () => import('../views/expert_classification/table.vue')
	},
	// 专家分类详情路由
	{
		path: '/expert_classification/view',
		name: '/expert_classification_view',
		component: () => import('../views/expert_classification/view.vue')
	},
	
	
		
		
		
	// 专家信息表格路由
	{
		path: '/expert_information/table',
		name: '/expert_information_table',
		component: () => import('../views/expert_information/table.vue')
	},
	// 专家信息详情路由
	{
		path: '/expert_information/view',
		name: '/expert_information_view',
		component: () => import('../views/expert_information/view.vue')
	},
	
		// 专家信息列表路由
	{
		path: '/expert_information/list',
		name: '/expert_information_list',
		component: () => import('../views/expert_information/list.vue')
	},
	
		// 专家信息详情路由
	{
		path: '/expert_information/details',
		name: '/expert_information_details',
		component: () => import('../views/expert_information/details.vue')
	},
		
		
		
	// 健康咨询表格路由
	{
		path: '/health_consultation/table',
		name: '/health_consultation_table',
		component: () => import('../views/health_consultation/table.vue')
	},
	// 健康咨询详情路由
	{
		path: '/health_consultation/view',
		name: '/health_consultation_view',
		component: () => import('../views/health_consultation/view.vue')
	},
		// 健康咨询添加路由
	{
		path: '/health_consultation/edit',
		name: '/health_consultation_edit',
		component: () => import('../views/health_consultation/edit.vue')
	},
	
	
		
		
		
	// 咨询回复表格路由
	{
		path: '/consultation_reply/table',
		name: '/consultation_reply_table',
		component: () => import('../views/consultation_reply/table.vue')
	},
	// 咨询回复详情路由
	{
		path: '/consultation_reply/view',
		name: '/consultation_reply_view',
		component: () => import('../views/consultation_reply/view.vue')
	},
	
	
		
		
		
	// 咨询反馈表格路由
	{
		path: '/advisory_feedback/table',
		name: '/advisory_feedback_table',
		component: () => import('../views/advisory_feedback/table.vue')
	},
	// 咨询反馈详情路由
	{
		path: '/advisory_feedback/view',
		name: '/advisory_feedback_view',
		component: () => import('../views/advisory_feedback/view.vue')
	},
	
	
		
		
		

	// 用户路由
	{
		path: '/user/index',
		name: 'user_index',
		component: () => import('../views/user/index.vue')
	},
	// 基本信息
	{
		path: '/user/info',
		name: 'user_info',
		component: () => import('../views/user/info.vue')
	},
	// 找回密码
	{
		path: '/user/password',
		name: 'user_password',
		component: () => import('../views/user/password.vue')
	},

	// 搜索
	{
		path: '/search',
		name: 'search',
		component: () => import('../views/search/index.vue')
	},
	// 局部搜索
	{
		path: '/search/details',
		name: 'search_details',
		component: () => import('../views/search/details.vue')
	}
]

const router = new VueRouter({
	mode: 'hash',
	base: process.env.BASE_URL,
	routes
})

router.afterEach((to, from, next) => {
	let title = "药膳食疗线上咨询系统-home";
	document.title = title;
	document.logo = "药膳食疗线上咨询系统"
})

router.beforeEach((to, from, next) => {
  window.scrollTo(0, 0);
  next();
});

export default router
